package tianrun.ziguan.api.calculate.config.controller.template;

import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tianrun.ziguan.api.calculate.config.dto.request.ModulesSaveBody;
import tianrun.ziguan.api.calculate.config.service.template.ITTemplateService;
import tianrun.ziguan.api.calculate.config.utils.HttpResponseTools;
import tianrun.ziguan.api.common.core.base.ResultBody;

@RestController
@RequestMapping("/template")
@Api(tags = "模板操作")
public class TemplateController {

    private final ITTemplateService templateService;

    public TemplateController(ITTemplateService templateService) {
        this.templateService = templateService;
    }


    @ApiOperation(value = "模板下拉框")
    @ApiResponses({@ApiResponse(code = 200, message = "ok")})
    @PostMapping("/selection")
    public ResponseEntity<ResultBody<JSONArray>> selection() {
        return HttpResponseTools.good(ResultBody.of(templateService.selection()));
    }



}
